package com.zack.util.collections.tuple;

import java.util.Optional;

/**
 * Created by simonpeng on 17/2/23.
 */
public abstract class Tuple {

    public static <E, T> Tuple of(E e, T t) {
        return new TuplePair<E, T>(e, t);
    }

    public static <E, T, S> Tuple of(E e, T t, S s) {
        return new TupleTriple<E, T, S>(e, t, s);
    }

    public abstract <E> Optional<E> first();

    public abstract <E> Optional<E> second();

    public abstract <E> Optional<E> third();


    public static void main(String[] args) {
        Tuple tup = Tuple.<String, Integer, Integer>of("hello", 123, 234);
        System.out.println(tup.first().get() + "\t" + tup.second().get() + "\t" + tup.third().get());
    }
}
